<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>后台--文章管理</title>
    <link rel="stylesheet" type="text/css" href="<?php echo isset($skin)?$skin:"";?>images/style.css" />
    <base target="_self"/>

    <script src='<?php echo isset($skin)?$skin:"";?>js/jquery.min.js'></script>
    <script type="text/javascript" src="<?php echo isset($skin)?$skin:"";?>js/jquery.form.min.js"></script>
    <script type="text/javascript" src="<?php echo isset($skin)?$skin:"";?>js/dist/dialog-min.js"></script>
    <script src="<?php echo isset($skin)?$skin:"";?>js/admin.js"></script>
    <script type="text/javascript">
        <!--
        $(document).ready(function () {
            $('.new_table tbody tr:even').addClass('h'); //奇偶变色，添加样式
        });
        //-->
    </script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>/js/validate.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artTemplate.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artTemplate-plugin.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/form.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artDialog.js"></script>
<script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/iframeTools.js"></script>
<link rel="stylesheet" href="<?php echo isset($skin)?$skin:"";?>js/artdialog.css" type="text/css">
</head>
<body>
<div class="hh6"></div>
<div class="mbx"><span class="fl"><a href="?">子不语商城管理中心</a>--<?php echo isset($name)?$name:"";?> </span><span class="fr"><a href="?c=category">商品分类</a></span> </div>

<form action="" name="myForm" method="post"  id="myForm">
    <table class="new_table" width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
        <thead>
        <tr class="n_bt"><td colspan="2" align="center">爱不语商城系统</td></tr>
        <tr><th height="28" colspan="2" class="thbt">【<?php echo isset($name)?$name:"";?>】</th></tr>
        </thead>
        <tbody>
        <tr>
            <td width="22%"  height="30" align="right">栏目名称：</td>
            <td width="78%"><input name="cat_name" type="text" class="input400" value="<?php echo isset($oj->cat_name)?$oj->cat_name:"";?>" /> <span>(*)</span></td>
        </tr>
        <tr>
            <td width="22%" height="30" align="right">SEO标题：</td>
            <td width="78%"><input name="short_name" type="text" class="input400" value="<?php echo isset($oj->short_name)?$oj->short_name:"";?>" /></td>
        </tr>

        <tr>
            <td height="30" align="right">上级栏目：</td>
            <td><select name="parent_id" class="input400 selecth" id="parent_id"><option value="0">顶级分类</option>
                    <?php if(is_array($catelist))  foreach($catelist as $v) { ?>
                    <option value="<?php echo isset($v->cat_id)?$v->cat_id:"";?>" <?php if($tid==$v->cat_id){?>selected<?php }?>><?php echo isset($v->cat_name)?$v->cat_name:"";?></option>
                    <?php }?></select></td>
        </tr>
        <tr>
            <td height="30" align="right">栏目排序：</td>
            <td><input name="sort" type="text" class="input400" value="<?php if($oj->sortrank){?>$oj.sortrank<?php }else{?>99<?php }?>" /></td>
        </tr>
        <tr>
            <td height="30" align="right">关键词：</td>
            <td><input name="keywords" type="text" class="input400" value="<?php echo isset($oj->keywords)?$oj->keywords:"";?>" /></td>
        </tr>
        <tr>
            <td height="30" align="right">描述：</td>
            <td><textarea  name="description" rows="5" class="input400 textareah"><?php echo isset($oj->description)?$oj->description:"";?></textarea></td>
        </tr>
        <tr>
            <td height="30" align="right">属性：</td>
            <td>
                <input name="is_show" type="checkbox" id="isshow" value="1" <?php if(!$oj->isshow && !$oj->id){?>checked="checked" <?php }?> /> 显示
            </td>
        </tr>

        <tr><td></td>
            <td height="40">
                <input class="button" name="into" type="submit" id="submit" value="提交" />
                <input name="id" type="hidden" value="<?php echo isset($oj->id)?$oj->id:"";?>" />
                <input type="hidden" name="a" value="<?php echo isset($form_action)?$form_action:"";?>" />
            </td>
        </tr>
        </tbody>
    </table>
</form>
<script type="text/javascript">
    $(document).ready(function() {
        var options = {
            //target: '#output',          //把服务器返回的内容放入id为output的元素中
            beforeSubmit: showRequest,  //提交前的回调函数
            success: showResponse,      //提交后的回调函数
            url: "?c=category&a=update",                 //默认是form的action， 如果申明，则会覆盖
            //type: type,               //默认是form的method（get or post），如果申明，则会覆盖
            //dataType: json,           //html(默认), xml, script, json...接受服务端返回的类型
            //clearForm: true,          //成功提交后，清除所有表单元素的值
            resetForm: true,          //成功提交后，重置所有表单元素的值
            timeout: 3000               //限制请求的时间，当请求大于3秒后，跳出请求
        }
        $('#myForm').ajaxForm(options);
    });
    function showRequest(formData, jqForm, options){
        var cat_name=document.myForm.cat_name;
        if(cat_name.value==''){
            lab_err(cat_name,"分类不能为空");
            return false;
        }
    }
</script>
<script type="text/javascript">
    <!--
    $(document).ready(function () {
        $('.new_table tbody tr:even').addClass('h'); //奇偶变色，添加样式
    });
    //-->
</script>
</body>
</html>